package com.zdpx.pxframework.system.api.api;

import com.zdpx.pxframework.core.constant.SecurityConstant;
import com.zdpx.pxframework.core.constant.ServiceNameConstant;
import com.zdpx.pxframework.core.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * 部门远程调用处理
 *
 * @Description:
 * @Author: Cheng XiaoXiao
 * @Date: 2022/5/27 15:38
 */
@FeignClient(value = ServiceNameConstant.SYSTEM_SERVICE, url = "${px.open-feign.system-url}")
public interface RemoteDepartmentInfoService {

    /**
     * 根据用户ID获取部门ID列表信息
     *
     * @param userId 用户ID
     * @return 部门列表ID
     */
    @GetMapping("/department-info/user/{userId}")
    Result<List<String>> listDepartmentIdsByUserId(@PathVariable("userId") String userId, @RequestHeader(SecurityConstant.FROM_SOURCE) String source);

    /**
     * 根据父ID查询子节点列表
     *
     * @param parentId 父ID
     * @return 子节点列表
     */
    @GetMapping("/department-info/children-node-ids/{parentId}")
    Result<List<String>> listChildrenIdsByParentId(@PathVariable("parentId") String parentId, @RequestHeader(SecurityConstant.FROM_SOURCE) String source);
}
